#include "../include/advection.hpp"
#include "../include/json.hpp"

using namespace std;
using namespace Eigen;
using json = nlohmann::json;

json openfile()
{
    ifstream file("./input/input.json");
    if (!file.is_open())
        cerr << "Failed to open file" << endl;
    json j;
    file >> j;
    file.close();
    return j;
}

enum method
{
    FTCS,
    leapfrog,
    Lax_Friedrichs,
    Lax_Wendorff,
    upwind,
    Beam_Warming
};

int main()
{
    json input = openfile();
    advection_equ ad;
    if (input["Method"] == 0)
        ad.FTCS();
    if (input["Method"] == 1)
        ad.leapfrog();
    if (input["Method"] == 2)
        ad.Lax_Friedrichs();
    if (input["Method"] == 3)
        ad.Lax_Wendorff();
    if (input["Method"] == 4)
        ad.upwind();
    if (input["Method"] == 5)
        ad.Beam_Warming();
    ad.plot();
    return 0;
}